You are here: Commerce Manager > System Administration > System Settings > Adding a Many to 1 Relation

Adding a Many to 1 Relation

You can relate business objects via a Many to 1 Relationship. For example, you can relate multiple contacts to a single organization or unit.

In the example below, N = Organization and 1 = related objects such as ParentId, PrimaryContactId etc.

To create Many to 1 relationships, click on a business object and click on the N:1 Relations tab.

Click on New Relation "Many to one" to create a new relationship.

The Relation N:1 form is very similar to the Relation 1:N form, except you can select the Primary Object from the dropdown, whereas the Related Object defaults to the name of the Business Object.

Under General Info, the Primary Object Organization is automatically set to Organization.

  1. Select a Primary Object to relate an the Organization object in the dropdown.The Object section below General Info will have a different title based on the Related Object name.
  2. Enter in a Field Name and Friendly Name. They are autopopulated already using the system name of the business object.
    Both names must be unique and not be the same as an existing field. The Field Name cannot contact spaces or special characters, only letters, numbers, and underscores.
  3. Checkmark the box Allow Nulls if you do not want this to be a required field the user fill in while editing a form. Otherwise, uncheck the box to make it a required field.
  4. Under Add Field To, checkmark the Forms you want the field to render in, such as the Edit Form (to enter and submit information) or View Form (read information only).
  5. Under the Object "Name of Primary Object" section, select a Display region in the dropdown box. Additional options such as Display Text and Display Order will appear based on your dropdown menu selection.
  6. Once all the relevant information is entered, click on Save.

Like an 1:N relationship, if you create a N:1 relationship with a Primary and Related Object, a 1:N relationship is automatically generated for the Primary Object under the 1:N tab.

 


Version: EPiServer Commerce 1 R2 SP2| Last updated: 2012-09-20 | Copyright © EPiServer AB | Send feedback to us